Last chance! 50% off unlimited learning
Sale ends in
Generates a parametric bootstrap for the median of scaled differences from each point in a data set to all other points..
bootMSD(x, ...) # S3 method for default
bootMSD(x, s = mad, B = 3000, probs = c(0.95, 0.99),
method = c("rnorm", "lhs"), keep = FALSE, labels = names(x), ...)
# S3 method for MSD
bootMSD(x, B = 3000, probs = c(0.95, 0.99),
method = c("rnorm", "lhs"), keep = FALSE, labels = names(x), ...)
An object of class "bootMSD", consisting of a vector of length length(x)
of median
scaled absolute deviations for each observation, with attributes:
vector of raw calculated MSD values calculated by msd
character vector of labels, by default taken from x
vextor of probabilities supplied and used for quantiles
matrix of quantiles. Each row corresponds to a probability
in probs
and each column to an individual data point.
p-values estimated as the observed proportion of
simulated values exceeding the MSD value calculated by msd
.
Number of bootstrap replicates used.
The sampling method used by the parametric bootstrap.
If keep == TRUE
, the individual bootstrap replicates
generated by bootMSD
. Set to NA
if keep == FALSE
.
Summary, print and plot methods are provided for the class; see bootMSD-class
.
An R object. For the default method, a vector of observations. For the MSD
method, an object of class "MSD"
. For print
, summary
and plot
methods, an object of class "bootMSD"
.
Either a function returning an estimate of scale for x
or a vector of
length length(x)
of standard errors or standard uncertainties in
x
.
Scalar number of bootstrap replicates.
Vector of probabilities at which to calculate upper quantiles. Passed to
quantile
.
Character value describing the simulation method.
If keep == TRUE
the individual bootstrap replicates are retained.
Character vector of labels for individual values.
Parameters passed to other methods.
S. L. R. Ellison s.ellison@lgcgroup.com
bootMSD
calculates a parametric bootstrap simulation (or Monte carlo simulation)
of the results of msd
applied to data. This allows individual case-specific
quantiles and p-values to be estimated that allow for different standard errors
(or standard uncertainties) s
.
The sampling method is currently either sampling from rnorm
or by latin hypercube sampling
using lhs
.
Individual upper quantiles for probabilities probs
and p-values are estimated
directly from the bootstrap replicates. Quantiles use quantile
. p-values
are estimated from the proportion of replicates that exceed the observed MSD calculated by
msd
. Note that the print
method for the summary
object does
not report zero proportions as identically zero.
Ellison, S. L. R. (2018) An outlier-resistant indicator of anomalies among inter-laboratory comparison data with associated uncertainty. _Metrologia_ (accepted 4 October 2018)
msd
, bootMSD-class
, print.bootMSD
,
plot.bootMSD
, summary.bootMSD
.
data(Pb)
if (FALSE) {
#Default method:
set.seed(1023)
boot.Pb.default <- bootMSD(Pb$value, Pb$u) # Uses individual standard uncertainties
summary(boot.Pb.default)
#Method for MSD object:
msd.Pb<-msd(Pb$value, Pb$u) # Uses individual standard uncertainties
boot.Pb <- bootMSD(msd.Pb, B=5000)
#Increased replication compared to default
summary(boot.Pb)
# NOTE: The default summary gives individual observation p-values.
# To correct for multiple comparisons, apply
# a suitable p-value adjustment:
summary(boot.Pb, p.adjust="holm")
}
Run the code above in your browser using DataLab